home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / a86b.arc / STRUC.DOC < prev    next >
Encoding:
Text File  |  1986-06-22  |  1.3 KB  |  33 lines

  1. ---STRUC.DOC---
  2.  
  3. The STRUC Directive
  4.  
  5. The STRUC directive is used to define a template of data to be addressed by one
  6. of the 8086's base and/or index registers.  The syntax of STRUC is as follows:
  7.  
  8. (optional strucname)  STRUC  (optional effective address)
  9.  
  10. The optional structure name given at the beginning of the line can appear
  11. in subsequent expressions in the program, with the operator TYPE applied to it,
  12. to yield the number of bytes in the structure template.
  13.  
  14. The STRUC directive causes the assembler to enter a mode similar to DATA
  15. SEGMENT, with the optional addition of indexing: if an effective address, which
  16. can include base registers [BX] or [BP] and/or index registers [SI] or [DI],
  17. is given at the end of the STRUC line, all variables declared between STRUC and
  18. ENDS will be indexed by the effective address.  For example:
  19.  
  20. LINE STRUC [BP]
  21.        DB 80 DUP (?)
  22. LSIZE  DB ?
  23. LPROT  DB ?
  24.      ENDS
  25.  
  26. The above STRUC defines the variables LSIZE, equivalent to [BP+80], and LPROT,
  27. equivalent to [BP+81].  You can now issue instructions such as MOV AL,LSIZE;
  28. which automatically generates the correct indexing for you.
  29.  
  30. The mode entered by STRUC is terminated by the ENDS directive, which returns the
  31. assembler to whatever segment (CODE or DATA) it was in before the STRUC.
  32.  
  33.